package appconfig

import (
	"github.com/spf13/viper"
	"log"
)

type Mysql struct {
	Host     string
	Port     int
	User     string
	Password string
	Database string
}
type Redis struct {
	Host     string
	Port     int
	Password string
}
type AppConfig struct {
	Mysql
	Redis
}

var AppCong AppConfig

func Init() {
	viper.SetConfigFile("appconfig/dev.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&AppCong)
	log.Println("viper 远程配置数据库成功")
}
